import { Injectable } from '@nestjs/common';

@Injectable()
export class HomeService {

      /**
  * 获取告警统计
  */
  getAlert(params: any) {
    const datalist = [
      { value: 1048, name: '网络异常' },
      { value: 735, name: '设备离线' },
      { value: 580, name: '超限警报' },
      { value: 484, name: '其他上报' }
    ];
    return datalist;
  }

  /**
  * 获取能耗数据
  */
  getEnergy(params: any) {
    const datalist = [];
    for(let i=1;i<13;i++){
      let num=Math.floor(Math.random()*1000);
      let item={
        month:i,
        value:num
      }
      datalist.push(item);
    }
   
    return datalist;
  }
}
